/*************************************************************************
	> File Name: P2842.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-02-19 17:55:57
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

#define MAX_N 100000
int dp[MAX_N + 5];
int val[MAX_N + 5];

int main() {
    int n, w;
    cin >> n >> w;
    for (int i = 1; i <= n; i++) {
        cin >> val[i];
    }
    for (int i = 1; i <= w; i++) dp[i] = INT32_MAX - 1;
    for (int i = 1; i <= n; i++) {
        for (int j = val[i]; j <= w; j++) {
            dp[j] = min(dp[j], dp[j - val[i]] + 1);
        }
    }
    cout << dp[w] << endl;
    return 0;
}
